package oop2;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class ClsasTest {
    public static void main(String[] args) {
        JadeClass j = new JadeClass();
        j.name = "java89班";
        j.dirTeacher = "孔老师";
        j.techTeacher = "老刘";
        Scanner in = new Scanner(System.in);
        int choice = 0;
        while (true) {
            System.out.println("1:添加学生 2:查看班级 3：找 人  4:在范围内找人 5:开除学员,6:加多人  9:退出");
            choice = in.nextInt();
            if (choice == 1) {
                System.out.print("新生姓名：");
                String name = in.next();
                boolean addok = j.add(name);
                System.out.println(addok ? "成功了" : "失败");
            } else if (choice == 2) {
                j.show();
            } else if (choice == 3) {

            } else if (choice == 4) {
                System.out.print("从哪里开始？");
                int start = in.nextInt();
                System.out.print("到哪里结束？");
                int end = in.nextInt();
                System.out.print("找谁？");
                String s = in.next();
                boolean b = j.search(start, end, s);
                System.out.println(b ? "这个人在这个班" : "不在！");
            } else if (choice == 5) {
                System.out.print("开除谁？");
                String name = in.next();
                boolean b = j.fire(name);
                System.out.println("开除的结果是" + b);
            } else if (choice == 6) {
                for (int i = 1; i < 50; i++) {
                    j.add("刘" + (int) (Math.random() * 1011009));
                }
            } else if (choice == 9) {
                System.out.println("再见");
                break;
            } else {
                System.out.println("无此功能");
            }
        }
    }
}
